package com.qaml.mes.device.repository;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.qaml.mes.device.dao.CheckUpkeepRecordDO;
import com.qaml.mes.device.dto.eqp.CheckUpkeepRecordAppDTO;
import com.qaml.mes.device.dto.eqp.CheckUpkeepRecordDTO;
import com.qaml.mes.device.dto.eqp.CheckUpkeepRecordListDTO;

import java.util.Date;
import java.util.List;

/**
 * @ClassName CheckUpkeepRecordRepository
 * @Description
 * @Author leikai
 * @Date 2024/2/27 0027 9:51
 * @Version 1.0
 */
public interface CheckUpkeepRecordRepository {

    void saveCheckUpkeepRecordDO(CheckUpkeepRecordDO checkUpkeepRecordDO);

    Long countByCheckUpkeepId(List<String> checkIds, String type, String status);


    List<CheckUpkeepRecordDO> getByCheckUpkeepId(List<String> checkIds);

    IPage<CheckUpkeepRecordDO> pageList(Integer page, Integer pageSize, CheckUpkeepRecordAppDTO recordAppDTO);

    /**
     * 根据检保任务id查询
     *
     * @param id
     * @return
     */
    CheckUpkeepRecordDO getById(String id);

    void updateById(CheckUpkeepRecordDO checkUpkeepRecordDO);

    /**
     * 后台分页查询
     *
     * @param page
     * @param pageSize
     * @param checkUpkeepRecordListDTO
     * @return
     */
    IPage<CheckUpkeepRecordDO> page(Integer page, Integer pageSize, CheckUpkeepRecordListDTO checkUpkeepRecordListDTO);

    /**
     * 更新归档状态
     *
     * @param type
     * @param startDateByMonth
     * @param endDateByMonth
     */
    void updateCheckUpkeepRecordArchive(String type, Date startDateByMonth, Date endDateByMonth);

    /**
     * 查询归档状态
     *
     * @param startDateByMonth
     * @param endDateByMonth
     * @param type
     * @return
     */
    List<CheckUpkeepRecordDO> selectCheckUpkeepStatus(Date startDateByMonth, Date endDateByMonth, String type);

    /**
     * 根据设备编码和检保类型和检保日期查询
     *
     * @param eqpCode
     * @param type
     * @param checkUpkeepDate
     * @return
     */
    CheckUpkeepRecordDO getByEqpCodeAndTypeAndCheckUpkeepDate(String eqpCode, String type, Date checkUpkeepDate);

    List<CheckUpkeepRecordDO> getByTypeAndCheckUpkeepDate(String type, Date startTime);


    /**
     * 根据检保任务id集合 给检保任务打上假期标记
     *
     * @param ids
     */
    void updateHolidayTipByIds(List<String> ids);
}